<template>
	<view class="noticeMsg">
		<view class="i-box" v-for="(item,index) in newsList" :key="index" @tap="goPage(item)">
			<view class="b-title">{{item.name}}</view>
			<view class="b-content">{{item.intro}}</view>
			<view class="b-time">{{item.time}}</view>
		</view>
		<m-bottom></m-bottom>
	</view>
</template>

<script>
	export default {
		name: "noticeMsg",
		data() {
			return {
				newsList: [],
				page:1,
				is_load:0
			}
		},
		onReachBottom(){
			if(this.is_load>0){
				this.page++
				this.$store.commit("CHANGESHOWlOADING",true)
				setTimeout(()=>{
					this.getNoticeList()
					this.$store.commit("CHANGESHOWlOADING",false)
				},1000)
			}

		},
		onShow(){
			this.getNoticeList()
		},
		methods:{
			goPage(item){
				this.$router.push({
					route:this.$routesConfig.noticeDetail,
					query:{id:item.id}
				})
			},
			async getNoticeList(){
				let params={}
				params.page=this.page
				let resData= await this.$apis.getNoticeList(params)
				console.log(resData)
				this.newsList.push(...resData.data.lists)
				this.is_load=resData.data.is_load
			}
		}

	}
</script>

<style lang="less" scoped>
	.noticeMsg {
		width:100%;
        position: relative;
		.i-box {
			width: 100%;
			box-sizing: border-box;
			padding: 0 20rpx ;
			border-bottom: solid 1px #C8C7CC;
			.b-title {
				padding: 40rpx 0 0 0;
				font-size: 28rpx;
				color: #333333;
				font-weight: bold;
				width: 100%px;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.b-content{
				padding-top: 10rpx;
				font-size: 24rpx;
				color: gray;
				width: 100%px;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				overflow: hidden;
			}
			.b-time{
				font-size: 24rpx;
				line-height: 100rpx;
				color: gray;
			}
		}
	}
</style>
